/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="fund_flow")
public class FundFlow implements Serializable {
	public FundFlow() {
	}
	
	private int id;
	
	private cn.imvc.app.entities.Account account;
	
	private cn.imvc.app.entities.Member member;
	
	private Integer year;
	
	private Integer month;
	
	private Integer day;
	
	private byte type;
	
	private String code;
	
	private String signed;
	
	private Integer money;
	
	private Integer amount;
	
	private String remark;
	
	private java.util.Date createdAt;
	
	private java.util.Date updatedAt;
	
	private String verify;
	
	private cn.imvc.app.entities.Member fromMember;
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_FUNDFLOW_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_FUNDFLOW_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	public void setYear(int value) {
		setYear(new Integer(value));
	}
	
	public void setYear(Integer value) {
		this.year = value;
	}
	
	@Column(name="year", nullable=true, length=11)	
	public Integer getYear() {
		return year;
	}
	
	public void setMonth(int value) {
		setMonth(new Integer(value));
	}
	
	public void setMonth(Integer value) {
		this.month = value;
	}
	
	@Column(name="month", nullable=true, length=11)	
	public Integer getMonth() {
		return month;
	}
	
	public void setDay(int value) {
		setDay(new Integer(value));
	}
	
	public void setDay(Integer value) {
		this.day = value;
	}
	
	@Column(name="day", nullable=true, length=11)	
	public Integer getDay() {
		return day;
	}
	
	/**
	 * 10现金充值  11佣金划入钱包  12加盟分佣  13订单分佣 20提现 21提现失败退款  30购买商品扣款 31购买商品退款  40分销商申请 41分销商升级
	 */
	public void setType(byte value) {
		this.type = value;
	}
	
	/**
	 * 10现金充值  11佣金划入钱包  12加盟分佣  13订单分佣 20提现 21提现失败退款  30购买商品扣款 31购买商品退款  40分销商申请 41分销商升级
	 */
	@Column(name="type", nullable=true)	
	public byte getType() {
		return type;
	}
	
	/**
	 * 订单编号
	 */
	public void setCode(String value) {
		this.code = value;
	}
	
	/**
	 * 订单编号
	 */
	@Column(name="code", nullable=true, length=255)	
	public String getCode() {
		return code;
	}
	
	/**
	 * 符号+ -
	 */
	public void setSigned(String value) {
		this.signed = value;
	}
	
	/**
	 * 符号+ -
	 */
	@Column(name="signed", nullable=true, length=255)	
	public String getSigned() {
		return signed;
	}
	
	/**
	 * 金额 无符号
	 */
	public void setMoney(int value) {
		setMoney(new Integer(value));
	}
	
	/**
	 * 金额 无符号
	 */
	public void setMoney(Integer value) {
		this.money = value;
	}
	
	/**
	 * 金额 无符号
	 */
	@Column(name="money", nullable=true, length=10)	
	public Integer getMoney() {
		return money;
	}
	
	/**
	 * 金额 有符号
	 */
	public void setAmount(int value) {
		setAmount(new Integer(value));
	}
	
	/**
	 * 金额 有符号
	 */
	public void setAmount(Integer value) {
		this.amount = value;
	}
	
	/**
	 * 金额 有符号
	 */
	@Column(name="amount", nullable=true, length=10)	
	public Integer getAmount() {
		return amount;
	}
	
	/**
	 * 备注
	 */
	public void setRemark(String value) {
		this.remark = value;
	}
	
	/**
	 * 备注
	 */
	@Column(name="remark", nullable=true, length=255)	
	public String getRemark() {
		return remark;
	}
	
	/**
	 * 创建时间
	 */
	public void setCreatedAt(java.util.Date value) {
		this.createdAt = value;
	}
	
	/**
	 * 创建时间
	 */
	@Column(name="createdAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getCreatedAt() {
		return createdAt;
	}
	
	public void setUpdatedAt(java.util.Date value) {
		this.updatedAt = value;
	}
	
	@Column(name="updatedAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getUpdatedAt() {
		return updatedAt;
	}
	
	/**
	 * 校验码
	 */
	public void setVerify(String value) {
		this.verify = value;
	}
	
	/**
	 * 校验码
	 */
	@Column(name="verify", nullable=true, length=255)	
	public String getVerify() {
		return verify;
	}
	
	public void setMember(cn.imvc.app.entities.Member value) {
		this.member = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Member.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="memberId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Member getMember() {
		return member;
	}
	
	public void setAccount(cn.imvc.app.entities.Account value) {
		this.account = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Account.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="accountId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Account getAccount() {
		return account;
	}
	
	public void setFromMember(cn.imvc.app.entities.Member value) {
		this.fromMember = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Member.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="fromMemberId", referencedColumnName="id") })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Member getFromMember() {
		return fromMember;
	}
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("FundFlow[ ");
			sb.append("Id=").append(getId()).append(" ");
			if (getAccount() != null)
				sb.append("Account.Persist_ID=").append(getAccount().toString(true)).append(" ");
			else
				sb.append("Account=null ");
			if (getMember() != null)
				sb.append("Member.Persist_ID=").append(getMember().toString(true)).append(" ");
			else
				sb.append("Member=null ");
			sb.append("Year=").append(getYear()).append(" ");
			sb.append("Month=").append(getMonth()).append(" ");
			sb.append("Day=").append(getDay()).append(" ");
			sb.append("Type=").append(getType()).append(" ");
			sb.append("Code=").append(getCode()).append(" ");
			sb.append("Signed=").append(getSigned()).append(" ");
			sb.append("Money=").append(getMoney()).append(" ");
			sb.append("Amount=").append(getAmount()).append(" ");
			sb.append("Remark=").append(getRemark()).append(" ");
			sb.append("CreatedAt=").append(getCreatedAt()).append(" ");
			sb.append("UpdatedAt=").append(getUpdatedAt()).append(" ");
			sb.append("Verify=").append(getVerify()).append(" ");
			if (getFromMember() != null)
				sb.append("FromMember.Persist_ID=").append(getFromMember().toString(true)).append(" ");
			else
				sb.append("FromMember=null ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
